//
//  AppViewController.m
//  storeapp
//
//  Created by huangyi on 12-11-29.
//  Copyright (c) 2012年 ios. All rights reserved.
//

#import "CViewController.h"
#import <QuartzCore/QuartzCore.h>

@interface CViewController ()

@end

@implementation CViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
        self.modalTransitionStyle=UIModalTransitionStyleCrossDissolve;
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(NSString*)description{
    NSArray *log=[NSArray arrayWithObjects:self.class,self.args, nil];
    return log.description;
}

-(BOOL)shouldAutorotate{
    return YES;
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{
    if ([self respondsToSelector:@selector(supportedInterfaceOrientations)]) {
        NSUInteger mask=[self supportedInterfaceOrientations];
        int supported=NO;
        switch (toInterfaceOrientation) {
            case UIInterfaceOrientationPortrait:
                supported=UIInterfaceOrientationMaskPortrait & mask;
                break;
            case UIInterfaceOrientationPortraitUpsideDown:
                supported=UIInterfaceOrientationMaskPortraitUpsideDown & mask;
                break;
            case UIInterfaceOrientationLandscapeLeft:
                supported=UIInterfaceOrientationMaskLandscapeLeft & mask;
                break;
            case UIInterfaceOrientationLandscapeRight:
                supported=UIInterfaceOrientationMaskLandscapeRight & mask;
                break;
            default:
                supported=0;
                break;
        }
        return supported==0?NO:YES;
    }else{
        return UIInterfaceOrientationPortrait==toInterfaceOrientation?YES:NO;
    }
}

-(NSUInteger)supportedInterfaceOrientations{
    return UIInterfaceOrientationMaskPortrait;
}
-(void)push{
    NSString *str=[NSString concatStrings:@"virtual function",NSStringFromClass(self.class), nil];
    NSCAssert(0, str);
}
-(void)pop{
    NSString *str=[NSString concatStrings:@"virtual function",NSStringFromClass(self.class), nil];
    NSCAssert(0, str);
}

@end
